<html>
    <head>
        <meta charset="UTF-8" />
        <title>tm.hash-observer.js Test</title>
        <style>
            * {
                -webkit-box-sizing: border-box;
                -moz-box-sizing: border-box;
                -o-box-sizing: border-box;
                box-sizing: border-box;
                font-family: "Meiryo", Arial, Helvetica, sans-serif;
                line-height: 1.5em;
            }
            
            body {
                font-size: 16px;
            }
        </style>
        <script src="tm.hash-observer.js"></script>
        <script>
            
            HTMLDocument.prototype.$query = HTMLElement.prototype.$query = function(query, index) {
                return (index) ?
                    this.querySelectorAll(query)[index] : 
                    this.querySelector(query);
            };
            
            window.onload = function()
            {
                tm.HashObserver.enable();
                
                document.addEventListener("changehash", function(e){
                    document.$query("#hash").innerText      = e.hash;
                    document.$query("#prevHash").innerText  = e.prevHash;
                }, false);
            };
        </script>
    </head>
    <body>
        <header>
            <h1>tm.form-observer.js Test</h1>
            <p>
            </p>
        </header>
        
        <section>
            <h2>Anchor Links</h2>
            <ul>
                <li><a href="#foo">foo</a></li>
                <li><a href="#bar">bar</a></li>
                <li><a href="#baz">baz</a></li>
                <li><a href="#qux">qux</a></li>
                <li><a href="#quux">quux</a></li>
                <li><a href="#foobar">foobar</a></li>
            </ul>
        </section>
        <section>
            <h2>Result</h2>
            <table border>
                <tr>
                    <th>Now Hash</th>
                    <td id="hash">　</td>
                </tr>
                <tr>
                    <th>Prev Hash</th>
                    <td id="prevHash">　</td>
                </tr>
            </table>
        </section>
    </body>
</html>






